function main(string){
  string = underline(string)
  string = lineFeed(string)
  string = yellowBackground(string)
  string = strong(string)
  string = narrow(string)
  string = fontRed(string)
  return string
}

function underline(string){
  let underRe = new RegExp("下划线\\(.*?\\)", 'g')
  let strArry = string.match(underRe)
  if(strArry){
    for(let i of strArry){
      let str = i.replace("下划线(", "").replace(")", "")
      string = string.replace(i, "<span class='underline'>" + str + "</span>")
    }
  }
  return string
}

function yellowBackground(string){
  let underRe = new RegExp("高亮\\(.*?\\)", 'g')
  let strArry = string.match(underRe)
  if(strArry){
    for(let i of strArry){
      let str = i.replace("高亮(", "").replace(")", "")
      string = string.replace(i, "<span class='yellowBackground'>" + str + "</span>")
    }
  }
  return string
}

function strong(string){
  let underRe = new RegExp("加粗\\(.*?\\)", 'g')
  let strArry = string.match(underRe)
  if(strArry){
    for(let i of strArry){
      let str = i.replace("加粗(", "").replace(")", "")
      string = string.replace(i, "<span class='strong'>" + str + "</span>")
    }
  }
  return string
}

function narrow(string){
  let underRe = new RegExp("缩小\\(.*?\\)", 'g')
  let strArry = string.match(underRe)
  if(strArry){
    for(let i of strArry){
      let str = i.replace("缩小(", "").replace(")", "")
      string = string.replace(i, "<span class='narrow'>" + str + "</span>")
    }
  }
  return string
}

function fontRed(string){
  let underRe = new RegExp("红色\\(.*?\\)", 'g')
  let strArry = string.match(underRe)
  if(strArry){
    for(let i of strArry){
      let str = i.replace("红色(", "").replace(")", "")
      string = string.replace(i, "<span class='redFont'>" + str + "</span>")
    }
  }
  return string
}

function lineFeed(string){
  string = string.replace(/。/g, "。<br/><span class='indent'></span>")
  return string
}

export default main
